<?php

require_once("lib/exception/internal_error_exception.php");

class Article_video_dao_factory {

	private static $instance;
	
	private function __construct() {}
	
	public static function singleton() {
        if (!isset(self::$instance)) {
            $c = __CLASS__;
            self::$instance = new $c;
        }

        return self::$instance;
    }
	
	public function get_dao() {
    	try {
    		if (include_once ARTICLE_VIDEO_DAO_FACTORY_DAOCLASSNAM . '.php') {
            	$classname = ARTICLE_VIDEO_DAO_FACTORY_DAOCLASSNAM;
            	return new $classname;
        	} else {
            	throw new Exception ("Driver article video not found");
        	}
    	}
    	catch (Exceptio $e) {
    		throw new Internal_error_exception($e);
    	}
	}
	
}
?>
